// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: Decoration
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
public alias 5 : SLOT_NOTES

//0 = Left
//1 = Down
//2 = Up
//3 = Right
//4 = Blank

private table ChartingTest
	//filler for slendermans first turn
	4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
	4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
	4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
	//ok now go
	0, 4, 3, 2, 4, 0, 4, 3, 2, 4, 0, 4, 3, 2, 1, 0, 4, 3, 2, 1, 1, 0, 4, 1, 1, 1, 3, 1, 1, 1, 4, 3, 0,
	1, 3, 2, 1, 4, 1, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
end table

reserve function Charting

function Charting
	object.value1++
	if object.value1 == 12
		object.value1 = 0
		object.value2++
		GetTableValue(temp2, object.value2, ChartingTest)
		CreateTempObject(TypeName[Arrow], temp2, temp1, temp0)
		object[tempObjectPos].ypos += 0x999999	
	end if
end function


event ObjectMain
	temp0 = object[0].ypos
	temp0 -= 4000000
	temp1 = object[0].xpos
	temp1 -= 2000000


	if stage.timeEnabled == 1	
	//	CallFunction(Charting)
	end if


	ResetObjectEntity(SLOT_NOTES, TypeName[Notes], 0, temp1, temp0)	
	
	Rand(temp3, 4)


	if inputPress[0].buttonZ == 1
	
	temp0 = object[0].ypos
	temp0 -= 4000000
	temp1 = object[0].xpos
	temp1 -= 2000000


	CreateTempObject(TypeName[Arrow], temp3, temp1, temp0)
	object[tempObjectPos].ypos += 0x999999

	end if

//idk what these are about they dont really work

//	BoxCollisionTest(C_TOUCH, object.entityPos, -32, -0, -15, 20, 0, C_BOX, C_BOX, C_BOX, C_BOX)	
//	BoxCollisionTest(C_TOUCH, object.entityPos, -12, -0, -21, 20, 0, C_BOX, C_BOX, C_BOX, C_BOX)	
//	BoxCollisionTest(C_TOUCH, object.entityPos, 0, -0, -14, 20, 0, C_BOX, C_BOX, C_BOX, C_BOX)		
//	BoxCollisionTest(C_TOUCH, object.entityPos, 16, -0, 0, 20, 0, C_BOX, C_BOX, C_BOX, C_BOX)	
end event

event ObjectDraw
if object[0].state != 1
	object.drawOrder = 5
	temp0 = object[0].ypos
	temp0 -= 4000000
	temp1 = object[0].xpos
	temp1 -= 2000000
	DrawSpriteXY(0, temp1, temp0)
	object.priority = PRIORITY_ACTIVE

	if inputdown[0].right == 1
		DrawSpriteXY(4, temp1, temp0)
	end if

	if inputdown[0].left == 1
		DrawSpriteXY(1, temp1, temp0)
	end if

	if inputdown[0].up == 1
		DrawSpriteXY(3, temp1, temp0)
	end if

	if inputdown[0].down == 1
		DrawSpriteXY(2, temp1, temp0)
	end if	
end if
end event


event ObjectStartup
	LoadSpriteSheet("3D_Test/Funkin.gif")
	SpriteFrame(0, -20, 64, 21, 1, 1)
	SpriteFrame(0, -15, 17, 12, 1, 28)	//left
	SpriteFrame(19, -18, 12, 17, 20, 25)	//doown
	SpriteFrame(33, -18, 12, 17, 34, 25)	//up	
	SpriteFrame(47, -15, 17, 12, 48, 28)	//right	
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
